<?php
class indexAction extends rareAction{
	public function execute(){
		$dao = new DaoImage();
		$type = $this->getGetParam('type',0);
		if($type==0||!in_array($type,array(service_type::BANNER,service_type::SLIDE))){
			$where = " typeID in(".service_type::BANNER.",".service_type::SLIDE.")";
		}else{
			$where = " typeID='{$type}' ";
		}
		if(!Tool::_getCache('isAdmin')&&in_array($type,array(service_type::BANNER,service_type::SLIDE))){
			Tool::_setCache('currentID',service_menu::getCurrent('1',$type));
		}
		list($images,$page) = $dao->getListPage($where,20);
		$this->assign('images',$images);
		$this->assign('page',$page);
		$this->assign('type',$type);
	}
}
?>
